package com.mytijian.openapi.adapter.alihalt.facade;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mytijian.openapi.adapter.alihalt.param.AlihaltBookParam;
import com.mytijian.openapi.adapter.alihalt.param.AlihaltCounterParam;
import com.mytijian.openapi.adapter.alihalt.param.AlihaltMcodeCheckParam;
import com.mytijian.openapi.adapter.alihalt.param.AlihaltMealInfoParam;
import com.mytijian.openapi.adapter.alihalt.param.AlihaltOrderQueryParam;
import com.mytijian.openapi.adapter.alihalt.param.AlihaltPDFReportQueryParam;
import com.mytijian.openapi.adapter.alihalt.result.AlihaltBaseResult;
import com.mytijian.openapi.adapter.alihalt.result.AlihaltBookResult;
import com.mytijian.openapi.adapter.alihalt.result.AlihaltCounterResult;
import com.mytijian.openapi.adapter.alihalt.result.AlihaltMealInfoResult;
import com.mytijian.openapi.adapter.alihalt.result.AlihaltOrderStatusResult;
import com.mytijian.openapi.adapter.alihalt.result.AlihaltPDFExamReportResult;
import com.mytijian.openapi.adapter.alihalt.service.AlihaltCounterService;
import com.mytijian.openapi.adapter.alihalt.service.AlihaltExamReportService;
import com.mytijian.openapi.adapter.alihalt.service.AlihaltMcodeCheckService;
import com.mytijian.openapi.adapter.alihalt.service.AlihaltMealInfoService;
import com.mytijian.openapi.adapter.alihalt.service.AlihaltOrderBookService;
import com.mytijian.openapi.adapter.alihalt.service.AlihaltOrderStatusQueryService;
import com.mytijian.runtime.model.service.AliService;
import com.mytijian.runtime.model.service.ServiceFacade;

/**
 * 阿里对接门面
 * 仅仅相当于最简单controller职责，不包含业务。
 * @author clozz
 *
 */
@Service
public class AlihaltAdapterFacade implements ServiceFacade {
	
	@Autowired
	private AlihaltMcodeCheckService alihaltMcodeCheckService;
	
	@Autowired
	private AlihaltMealInfoService alihaltMealInfoService;
	
	@Autowired
	private AlihaltCounterService alihaltCounterService;
	
	@Autowired
	private AlihaltOrderBookService alihaltOrderBookService;
	
	@Autowired
	private AlihaltOrderStatusQueryService alihaltOrderStatusQueryService;
	
	@Autowired
	private AlihaltExamReportService alihaltExamReportService;
	
	@AliService(aliMethodName = "alibaba.alihealth.healtharchive.examination.login")
	public AlihaltBaseResult login(AlihaltMcodeCheckParam param) {
		AlihaltBaseResult result = alihaltMcodeCheckService.checkMcode(param);
		return result;
	}
	
	@AliService(aliMethodName="alibaba.alihealth.healtharchive.examination.packageinfo")
	public AlihaltMealInfoResult mealInfo(AlihaltMealInfoParam param) {
		AlihaltMealInfoResult result = alihaltMealInfoService.getMealInfo(param);
		return result;
	}
	
	@AliService(aliMethodName="alibaba.alihealth.healtharchive.examination.checkunitscheduletime")
	public AlihaltCounterResult date(AlihaltCounterParam param) {
		AlihaltCounterResult result =  alihaltCounterService.getCounter(param);
		return result;
	}
	
	@AliService(aliMethodName="alibaba.alihealth.healtharchive.examination.createreserve")
	public AlihaltBookResult book(AlihaltBookParam param) {
		AlihaltBookResult result = alihaltOrderBookService.book(param);
		return result;
	}
	
	@AliService(aliMethodName="alibaba.alihealth.healtharchive.examination.reservestate")
	public AlihaltOrderStatusResult getOrderStatus(AlihaltOrderQueryParam param) {
		AlihaltOrderStatusResult result = alihaltOrderStatusQueryService.getOrderStatus(param);
		return result;
	}
	
	@AliService(aliMethodName = "alibaba.alihealth.healtharchive.examination.getreport")
	public AlihaltPDFExamReportResult getPDFReport(AlihaltPDFReportQueryParam param) {
		AlihaltPDFExamReportResult result = alihaltExamReportService.getPDFReport(param);
		return result;
	}
}
